package gmusic.ma.bo;

import gmusic.bo.TrackBean;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

public class TrackMABean extends TrackBean implements Serializable {

	protected String URLCover;
	
	public TrackMABean() {
	}

	public TrackMABean(long maid, long releaseMaid, int discNum, String nom,
			int duree, int numero) {
		super();
		setMaid(maid);
		setReleaseMaid(releaseMaid);
		setDisc(discNum);
		setNom(nom);
		setDuree(duree);
		setNumero(numero);
	}

	public TrackMABean(ResultSet rs) throws SQLException {
		setMaid(rs.getLong("maid"));
		setReleaseMaid(rs.getLong("release_maid"));
		setDisc(rs.getInt("disc"));
		setNumero(rs.getInt("num"));
		setNom(rs.getString("nom"));
		setDuree(rs.getInt("duree"));
		setLyrics(rs.getString("lyric"));
	}

	public String toString() {
		return "[amid=" + maid + ";release_id=" + releaseId + ";disc=" + disc
		+ ";num=" + numero + ";titre=" + nom + ";duree=" + duree + "]";
	}
	
	public String toString4Console() {
		return "[MAID " + getMaid() + "] " + disc + " " + (numero < 10 ? " " : "")
				+ numero + " " + nom;
	}

	public String getURLCover() {
		return URLCover;
	}

	public void setURLCover(String cover) {
		URLCover = cover;
	}
}
